package com.sfac.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description TestController
 * @Author JiangHu
 * @Date 2022/7/18 9:36
 */
@RestController
@RequestMapping("/api/test")
@RefreshScope
public class TestController {

	@Value("${com.sfac.name}")
	private String name;
	@Value("${com.sfac.age}")
	private String age;

	/**
	 * 127.0.0.1/api/test/config ---- get
	 */
	@GetMapping(value = "/config")
	public String configTest() {
		return String.format("Config: %s ---- %s", name, age);
	}
}
